﻿<Page
    x:Class="KoolearnSample.Views.Open.Demo"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:KoolearnSample.Views.Open"
    xmlns:control="using:KoolearnSample.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Style="{StaticResource BackgroundStyle}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="100"></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <Grid VerticalAlignment="Bottom">
                <StackPanel Orientation="Horizontal">
                    <Button Click="Button_Click_1" Style="{StaticResource BackButtonStyle}" Margin="36,0,36,18"></Button>
                    <TextBlock FontSize="40" VerticalAlignment="Center" Text="公开课测试" Margin="10,0"></TextBlock>
                </StackPanel>
                <control:KoolearnNetwork HorizontalAlignment="Right"
                                         VerticalAlignment="Center"
                                         Margin="30,0"></control:KoolearnNetwork>
            </Grid>
            <Grid Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300"></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <ListView Name="ListCategory"
                          CanDragItems="True"
                          IsItemClickEnabled="True"
                          ItemClick="ListCategory_ItemClick_1"
                          ItemTemplate="{StaticResource ListCategoryTemplate}"
                          ItemsSource="{Binding Categorys}"
                          Margin="30">
                    <ListView.ItemsPanel>
                        <ItemsPanelTemplate>
                            <VirtualizingStackPanel></VirtualizingStackPanel>
                        </ItemsPanelTemplate>
                    </ListView.ItemsPanel>
                </ListView>
                <Grid Name="GridCourses" Grid.Column="1">
                    <GridView Name="ListCourse" 
                              ItemTemplate="{StaticResource ListCourseTemplate}"
                              ItemsSource="{Binding Courses}"
                              Margin="30">
                    </GridView>
                </Grid>

            </Grid>
        </Grid>
        <Popup Name="PopupLoading" IsOpen="True" 
               Width="236"
               Height="100"
               HorizontalAlignment="Center"
               VerticalAlignment="Center">
            <Grid>
                <control:KoolearnLoading></control:KoolearnLoading>
            </Grid>
        </Popup>
        <!--贴靠窗体-->
        <Grid Name="GridSnapped" Visibility="Collapsed">
            <TextBlock HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       FontSize="60"
                       Text="Koolearn"></TextBlock>
        </Grid>
        <!--视觉状态-->
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="LanscapeFullScreen">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="grid1">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="GridSnapped">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>

                </VisualState>
                <VisualState x:Name="PortraitFullScreen"></VisualState>
                <VisualState x:Name="Filled"></VisualState>
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="grid1">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="GridSnapped">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</Page>